import {createApp} from 'vue';
import App from './App.vue';
import router from './router/index.js';

const app = createApp(App);
app.use(router);

// 全局前置守卫
router.beforeEach((to, from, next) => {
    console.log(`Navigating from ${from.path} to ${to.path}`);
    next();
});

// 错误处理
app.config.errorHandler = (err, vm, info) => {
    console.error('Error in', info, 'of component:', vm, err);
};

app.mount('#app');